<?php
	require_once ("db_connection.php");

	$date = date("Y-m-d H:i:s");
	$affiliateid = $_POST['affiliateid'];
	
	
	/* start  add to oneway rate table */
		$id = "VI-" . uniqid();
		$distanceone = mysql_real_escape_string($_POST["distanceone"]);
		$rateone = $_POST["rateone"];
		
		$query = "INSERT INTO onewayrate(onewayid,affiliateid,vehicletype,vehiclemodel,distance, currency, rate, date)
		VALUES('$id','$affiliateid','$_POST[vehicletype]','$_POST[vehiclemodelone]','$distanceone', '$_POST[currencyone]', '$rateone', '$date')";
		
		if(!mysql_query($query, $con)){
			die('Error: '. mysql_error());
		}
	/* end  add to oneway rate table */	


	echo "Saved! ";
	flush();
	mysql_close($con);
?>